home *** CD-ROM | disk | FTP | other *** search
- /*
- File: simple.h
-
- Contains:
-
- Written by: C.K. Haun
-
- Copyright: Copyright © 1991-1999 by Apple Computer, Inc., All Rights Reserved.
-
- You may incorporate this Apple sample source code into your program(s) without
- restriction. This Apple sample source code has been provided "AS IS" and the
- responsibility for its operation is yours. You are not permitted to redistribute
- this Apple sample source code as "Apple sample source code" after having made
- changes. If you're going to re-distribute the source, we require that you make
- it clear in the source that the code was descended from Apple sample source
- code, but that you've made changes.
-
- Change History (most recent first):
- 8/10/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1
-
-
- */
-
-
- typedef void (*myDrawProcPtr)(WindowPtr theWindow);
- typedef void (*myClickProcPtr)(WindowPtr theWindow,EventRecord *theEvent);
- typedef void (*windowSaveProc)(WindowPtr theWindow);
- typedef void (*myCloseProcPtr)(WindowPtr theWindow);
- typedef void (*mySizeProcPtr)(WindowPtr theWindow,short how);
- typedef void (*myActivateProcPtr)(WindowPtr theWindow,Boolean active);
-
- /* windowControl is the structure attached to every window I create (in the refCon */
- /* field) that contains all the information I need to know about the window. */
- /* data, procedure pointers for controlling, and anything else gets put in this */
- /* struct. That makes my windows autonomous */
- struct windowControl {
- unsigned long windowID; /* master ID number */
- myDrawProcPtr drawMe; /* content drawing procedure pointer */
- myClickProcPtr clickMe; /* content click routine */
- myCloseProcPtr closeMe; /* document close procedure pointer */
- mySizeProcPtr sizeMe; /* size procedure */
- myActivateProcPtr activateMe;
- AliasHandle fileAliasHandle; /* alias for this document */
- Boolean windowDirty;
- Handle generalData; /* cast to whatever you need as you need it */
- };
- typedef struct windowControl windowControl, *windowCPtr, **windowCHandle;
-
- struct AEinstalls {
- AEEventClass theClass;
- AEEventID theEvent;
- AEEventHandlerProcPtr theProc;
- };
- typedef struct AEinstalls AEinstalls;
-
- enum {kDocWindowResID = 128,kMyDocumentWindow = 1000};
- /* menu enums */
- enum {kMBarID = 128};
- enum {kAppleMenu = 128,kFileMenu,kEditMenu,kToolsMenu};
-
- /* file menu enums */
- enum {kNewItem = 1,kOpenItem,kCloseItem,kSaveItem,kSaveAsItem,kFileBlank1,kPageSetupItem,kPrintItem,kFileBlank2,kQuitItem};
-
- /* general purpose enums */
- enum {kResumeMask=1,kSampHelp=129,kAboutBox=128,kHelpString=128,kBadSystem=130};
-
- enum {kMinHeight = 200};
-
- enum {kGeneralStrings = 128};